# Maintainer:
pkgname=py3-pysequoia
pkgver=0.1.20
pkgrel=1
pkgdesc="Pythong bindings for the Sequoia PGP library"
url="https://codeberg.org/wiktor/pysequoia"
# rust-ring
arch="all !s390x !ppc64le !riscv64"
license="Apache-2.0"
makedepends="
	bzip2-dev
	cargo
	clang-libclang
	gmp-dev
	nettle-dev
	openssl-dev
	pcsc-lite-dev
	py3-gpep517
	py3-maturin
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/wiktor/pysequoia/archive/v$pkgver.tar.gz"
builddir="$srcdir/pysequoia"
options="net" # cargo

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--config-json '{"build-args": "--frozen"}' \
		--output-fd 3 3>&1 >&2
}

check() {
	cargo test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1db48aa093420cc9733b122a96b813923e4e7ef040ddc8d79df1a1d0a2c6d26ffd33e9c56c4873df17720e374a377a4f294c0e8d0a134625b8daefc3bd74a9e2  py3-pysequoia-0.1.20.tar.gz
"
